package com.xbongbong.util;

import com.xbongbong.paas.toolbox.util.URLEncodeUtils;

/**
 * @author 吴峰
 * @date 2022/08/12 15:47
 */
public class CoolAppCardUtil {

    /**
     * 群id解码，前端传之前编码
     *
     * @param openConversationId
     * @return
     */
    public static String decodeOpenConversationId(String openConversationId) {
        String result = URLEncodeUtils.decodeURL(openConversationId);
        // decode解码后可能还有编辑，再解码一次
        if (result.contains("%")) {
            result = URLEncodeUtils.decodeURL(result);
        }
        result = result.replaceAll(" ", "+");
        return result;
    }
}
